-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add inspectBulkRequest method #547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d766dac to
68ff04e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new inspectBulkRequest method to the DataProtector SDK, enabling users to inspect the status and details of bulk requests without waiting for completion. Additionally, it includes several refactorings: renaming isValidProvider to isValidSigner for clarity, simplifying chain ID detection by delegating to IExecNetworkModule, and adding infrastructure support for the PoCo subgraph.
Key changes:
- New
inspectBulkRequestmethod provides detailed inspection of bulk request status, tasks, and optionally results - Integration with PoCo subgraph to retrieve protected data addresses per task
- Refactored validation function renamed from
isValidProvidertoisValidSignerto better reflect its purpose - Simplified
getChainIdFromProviderimplementation by leveragingIExecNetworkModule
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/lib/dataProtectorCore/inspectBulkRequest.ts | Implements the core inspectBulkRequest method with support for fetching task details, statuses, and optional results |
| packages/sdk/src/lib/dataProtectorCore/getProtectedDataInBulk.ts | Helper function to retrieve protected data addresses for tasks in a bulk request from the PoCo subgraph |
| packages/sdk/src/lib/dataProtectorCore/subgraph/getProtectedDataInBulkByBulkRequestHash.ts | GraphQL query wrapper to fetch task and dataset information from PoCo subgraph |
| packages/sdk/src/lib/dataProtectorCore/IExecDataProtectorCore.ts | Adds inspectBulkRequest method to the public API and renames validation calls from isValidProvider to isValidSigner |
| packages/sdk/src/lib/types/coreTypes.ts | Defines types for InspectBulkRequestParams and InspectBulkRequestResponse, and splits TaskStatus into TaskStatus and TaskStatusFinal |
| packages/sdk/src/lib/types/internalTypes.ts | Adds PocoSubgraphConsumer type for PoCo subgraph client dependency injection |
| packages/sdk/src/lib/IExecDataProtectorModule.ts | Initializes PoCo subgraph client during module configuration |
| packages/sdk/src/utils/validators.ts | Renames isValidProvider to isValidSigner for better clarity |
| packages/sdk/src/utils/getChainId.ts | Simplifies chain ID detection by delegating to IExecNetworkModule instead of handling different provider types manually |
| packages/sdk/tests/e2e/dataProtectorCore/inspectBulkRequest.test.ts | Comprehensive E2E tests covering INITIALIZING, IN_PROGRESS, and FINISHED bulk request states with various options |
| packages/sdk/tests/test-utils.ts | Adds pocoSubgraphURL to test configuration |
| packages/sdk/tests/docker-compose.yml | Adds poco-subgraph-deployer service to the test stack |
| packages/sdk/tests/prepare-iexec.js | Script to patch iexec dependency for testing purposes (disables checkImplementedOnChain) |
| packages/sdk/package.json | Adds test:prepare script and integrates it into start-test-stack |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/sdk/src/lib/dataProtectorCore/getProtectedDataInBulk.ts
Outdated
Show resolved
Hide resolved
packages/sdk/src/lib/dataProtectorCore/getProtectedDataInBulk.ts
Outdated
Show resolved
Hide resolved
packages/sdk/tests/e2e/dataProtectorCore/inspectBulkRequest.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
packages/sdk/src/lib/dataProtectorCore/getProtectedDataInBulk.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Note
Introduces an API to inspect the lifecycle and results of bulk requests, backed by the PoCo subgraph.
inspectBulkRequestinIExecDataProtectorCorewithdetailed(protected data addresses) andwithResult(optional result download) optionspocoSubgraphClient, and query tasks/datasets viagetProtectedDataInBulk*TaskStatusinto non-final and final states, addsInspectBulkRequest*request/response typesisValidProviderwithisValidSigner; derive chainId usingIExecNetworkModuleinspectBulkRequest; include PoCo subgraph indocker-compose; addtest:prepare(patches iexec check) and wire intostart-test-stack; wire PoCo subgraph URL in test utilsWritten by Cursor Bugbot for commit 3cbf7c0. This will update automatically on new commits. Configure here.